﻿using System;
using System.Collections.Generic;
using System.Text;

using System.Drawing;

namespace NGE
{
    [Serializable]
    public class Option
    {
        public int KeyU = 17;
        public int KeyD = 31;
        public int KeyL = 30;
        public int KeyR = 32;
        public int KeyA = 36;
        public int KeyB = 37;
        public int KeyX = 1;
        public int KeyY = 28;       

        public KeyboardHandleMode KeyboardHandleModel = KeyboardHandleMode.DirectInput;

        public string FontName = "Microsoft JhengHei";
        public float FontSize = 12;
        public FontStyle FontStyle = FontStyle.Regular;

        [NonSerialized]
        Font font;
        public Font Font
        {
            get
            {
                if (font == null)
                {
                    font = new Font(FontName, FontSize, FontStyle, GraphicsUnit.Pixel);
                }
                return font;
            }
        }        
        
        public Size WindowSize = new Size(640, 480);
        public DrawMode DrawMode = DrawMode.GPU;
        public double Zoom = 2.0;
        public string ServerName = "mh.meibu.com";
        public string ServerIP = "0.0.0.0";
        public int ServerPort = 35535;
        public bool IsShowWindowBorder = true;
        public bool IsFullScreen = false;
        public int Volume = -1000;

        public string dataPath = "data";
        public string imagePath = "image";
        public string soundPath = "sound";
        public string scenePath = "scene";
        public string menuPath = "menu";
        public string propPath = "prop";
        public string scriptPath = "script";
        public string animationPath = "animation";
        public string characterPath = "character";

        public string NewGameScriptFile = "ng.nspt";

        public string CharacterPath
        {
            get
            {
                return DataRootPath + characterPath + "\\";
            }
        }
        public string PropPath
        {
            get
            {
                return DataRootPath + propPath + "\\";
            }
        }
        public string AnimationPath
        {
            get
            {
                return DataRootPath + animationPath + "\\";
            }
        }
        public string ImagePath
        {
            get
            {
                return DataRootPath + imagePath + "\\";
            }
        }
        public string MenuPath
        {
            get
            {
                return DataRootPath + menuPath + "\\";
            }
        }
        public string SoundPath
        {
            get
            {
                return DataRootPath + soundPath + "\\";
            }
        }
        public string ScenePath
        {
            get
            {
                return DataRootPath + scenePath + "\\";
            }
        }
        public string DataRootPath
        {
            get
            {
                return ".\\" + dataPath + "\\";
            }
        }
        //public Size WindowSize
        //{
        //    get
        //    {
        //        return new Size(WindowSizePixel.Width / TileSizePixel.Width, WindowSizePixel.Height / TileSizePixel.Height);
        //    }

        //}
        //public Size TileSizePixel
        //{
        //    get
        //    {
        //        return new Size((int)(tileSizePixel.Width * Zoom), (int)(tileSizePixel.Height * Zoom));
        //    }
        //}
    }

}
